#  项目的初始化文件
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()

def CreateApp(Config):
    app = Flask(__name__)  ## 实例化
    app.config.from_object(Config)  ## 加载
    # db = SQLAlchemy(app)  # 实例化 sqlalchemy
    db.init_app(app)        ## 将db 和app 绑定
    from FlaskOA.OA import oa_bl

    app.register_blueprint(oa_bl, url_prefix="/oa")  # 注册蓝图
    return app



